#set UnusedPin
set_property BITSTREAM.CONFIG.UNUSEDPIN Pullnone [current_design]

# key setting 
set_property -dict {PACKAGE_PIN A20 IOSTANDARD LVCMOS33} [get_ports key_eth_rst_n]
set_property -dict {PACKAGE_PIN B20 IOSTANDARD LVCMOS33} [get_ports key_arp_req]
set_property -dict {PACKAGE_PIN B21 IOSTANDARD LVCMOS33} [get_ports key_udp_tx]

# led setting
set_property -dict {PACKAGE_PIN M22 IOSTANDARD LVCMOS33} [get_ports led[0]]
set_property -dict {PACKAGE_PIN N22 IOSTANDARD LVCMOS33} [get_ports led[1]]
set_property -dict {PACKAGE_PIN L21 IOSTANDARD LVCMOS33} [get_ports led[2]]
set_property -dict {PACKAGE_PIN K21 IOSTANDARD LVCMOS33} [get_ports led[3]]
set_property -dict {PACKAGE_PIN K22 IOSTANDARD LVCMOS33} [get_ports led[4]]
set_property -dict {PACKAGE_PIN J22 IOSTANDARD LVCMOS33} [get_ports led[5]]
set_property -dict {PACKAGE_PIN H22 IOSTANDARD LVCMOS33} [get_ports led[6]]
set_property -dict {PACKAGE_PIN M21 IOSTANDARD LVCMOS33} [get_ports led[7]]

# system setting
set_property -dict {PACKAGE_PIN F15 IOSTANDARD LVCMOS33} [get_ports sys_rst_n]
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets sys_rst_n]
set_property -dict {PACKAGE_PIN Y18 IOSTANDARD LVCMOS33} [get_ports sys_clk]
create_clock -period 20.000 -name sys_clk [get_ports sys_clk]

# ov5640 setting
set_property -dict {PACKAGE_PIN B1 IOSTANDARD LVCMOS33} [get_ports cam_pclk]
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets cam_pclk]
# set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets u_wiz2/inst/clk_in1_clk_wiz_2]

set_property -dict {PACKAGE_PIN B2 IOSTANDARD LVCMOS33} [get_ports img_vsync]
set_property -dict {PACKAGE_PIN A1 IOSTANDARD LVCMOS33} [get_ports img_href]
set_property -dict {PACKAGE_PIN M20 IOSTANDARD LVCMOS33} [get_ports sccb_scl]
set_property -dict {PACKAGE_PIN L18 IOSTANDARD LVCMOS33} [get_ports sccb_sda]
set_property PULLUP true [get_ports sccb_scl]
set_property PULLUP true [get_ports sccb_sda]
set_property -dict {PACKAGE_PIN N20 IOSTANDARD LVCMOS33} [get_ports cam_rst_n]
set_property -dict {PACKAGE_PIN L1 IOSTANDARD LVCMOS33} [get_ports cam_pwdn]
set_property -dict {PACKAGE_PIN M17 IOSTANDARD LVCMOS33} [get_ports cam_xclk]
set_property -dict {PACKAGE_PIN J2 IOSTANDARD LVCMOS33} [get_ports img_data[0]]
set_property -dict {PACKAGE_PIN J1 IOSTANDARD LVCMOS33} [get_ports img_data[1]]
set_property -dict {PACKAGE_PIN G1 IOSTANDARD LVCMOS33} [get_ports img_data[2]]
set_property -dict {PACKAGE_PIN H2 IOSTANDARD LVCMOS33} [get_ports img_data[3]]
set_property -dict {PACKAGE_PIN F1 IOSTANDARD LVCMOS33} [get_ports img_data[4]]
set_property -dict {PACKAGE_PIN G2 IOSTANDARD LVCMOS33} [get_ports img_data[5]]
set_property -dict {PACKAGE_PIN D1 IOSTANDARD LVCMOS33} [get_ports img_data[6]]
set_property -dict {PACKAGE_PIN E1 IOSTANDARD LVCMOS33} [get_ports img_data[7]]

# udp setting
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets eth_rxc]
create_clock -period 8.000 -name eth_rxc [get_ports eth_rxc]
set_property -dict {PACKAGE_PIN T21 IOSTANDARD LVCMOS33} [get_ports eth_rxc]
set_property -dict {PACKAGE_PIN AB18 IOSTANDARD LVCMOS33} [get_ports eth_rxctl  ]
set_property -dict {PACKAGE_PIN V17 IOSTANDARD LVCMOS33 } [get_ports eth_rxd[0] ]
set_property -dict {PACKAGE_PIN V18 IOSTANDARD LVCMOS33 } [get_ports eth_rxd[1] ]
set_property -dict {PACKAGE_PIN P19 IOSTANDARD LVCMOS33 } [get_ports eth_rxd[2] ]
set_property -dict {PACKAGE_PIN R19 IOSTANDARD LVCMOS33 } [get_ports eth_rxd[3] ]
set_property -dict {PACKAGE_PIN U22 IOSTANDARD LVCMOS33 } [get_ports eth_txc    ]
set_property -dict {PACKAGE_PIN AA19 IOSTANDARD LVCMOS33} [get_ports eth_txctl  ]
set_property -dict {PACKAGE_PIN U21 IOSTANDARD LVCMOS33 } [get_ports eth_txd[0] ]
set_property -dict {PACKAGE_PIN W22 IOSTANDARD LVCMOS33 } [get_ports eth_txd[1] ]
set_property -dict {PACKAGE_PIN W21 IOSTANDARD LVCMOS33 } [get_ports eth_txd[2] ]
set_property -dict {PACKAGE_PIN Y22 IOSTANDARD LVCMOS33 } [get_ports eth_txd[3] ]
set_property -dict {PACKAGE_PIN V22 IOSTANDARD LVCMOS33 } [get_ports eth_rst_n  ]

# ddr setting
create_clock -period 10.000 -name ddr3_ui_clk [get_ports ddr3_ui_clk]

# set_clock_groups -asynchronous -group [get_clocks [get_clocks -of_objects [get_pins u_mig_7series_0/u_mig_7series_0_mig/u_ddr3_infrastructure/gen_mmcm.mmcm_i/CLKFBOUT]]] -group [get_clocks [get_clocks -of_objects [get_pins pll/inst/plle2_adv_inst/CLKOUT2]]]

